Are you looking for a way to accept payment in your account at 0% Transaction Fee for products or services easier and more secure?
UPIGateway’s Dynamic QR Code Service can help you do just that. It’s important to know that UPIGateway does not provide payment gateway services, but it offers a powerful solution to help you revolutionize your payment methods.
Also Read: How to Integrate PhonePe Payment Gateway in PHP
What is UPIGateway’s Dynamic QR Code Service?
UPIGateway’s Dynamic QR Code Service simplifies the payment process for your customers. Here’s how it works:
- Customer Selection: Your customer selects their desired product on your website and proceeds to the checkout.
- Dynamic QR Generation: During checkout, UPIGateway generates an active QR code, which is then prominently displayed on your website.
- Seamless Payments: The customer can effortlessly pay using any UPI app by scanning the generated QR code.
- Transaction Verification: Following the payment, UPIGateway takes care of verifying the transaction and promptly sends a status response through a webhook.
Advantages of Integrating UPIGateway’s Dynamic QR Code Service
When you integrate UPIGateway’s Dynamic QR Code Service, you unlock several key advantages that can transform your payment processes:
- Easy Integration: UPIGateway’s solution is designed for straightforward integration, ensuring that you can implement it with ease.
- Support for All UPI Apps: Your customers have the flexibility to choose their preferred UPI app, as UPIGateway’s service supports a wide range of UPI applications.
- Security and Seamlessness: Security is paramount. UPIGateway’s service provides a secure and seamless payment experience for your customers, enhancing trust and reliability.
- Error-Free Transactions: Say goodbye to payment hiccups. UPIGateway’s service is designed to minimize errors, ensuring smooth transactions for you and your customers.
Steps to Integrating UPIGateway Dynamic QR Code in PHP
The process involves several steps, like creating a merchant account for handling payments, getting essential API credentials, and setting up how the payment gateway works.
Let’s suppose you already have a merchant account and API credentials for UPIGateway. In that case, you can follow this example to accept payment using the UPIGateway Dynamic QR Code on your website:
Before starting, create your merchant account with UPIGateway https://merchant.upigateway.com/auth/register
Are you want to get implementation help, or modify or extend the functionality of this script?
A Tutorialswebsite Expert can do it for you.
Step 1: How to get UPIGateway API KEY?
You can follow the below screenshot to get API KEY in your UPIGateway account.
Step 2: Payment request data (Payload)
You have to replace the API key with your live API key in the below code. Also, you need to add your callback_url.
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$callback_url = "https://yourdomain.com/success.php"; // your callback url $payload_data = array( 'key' => "YOUR_API_KEY", // replace with your live API KEY 'client_txn_id' => "0123456789", 'amount' => "100", 'p_info'=>"Product Name", 'customer_name'=>"Tutorials Website", 'customer_email'=>"tutorialswebsite@gmail.com", "customer_mobile"=>"9876543210", 'redirect_url'=>"$callback_url" ); |
Step 3: Convert your Payload to JSON format
2 3 4 |
$jsonPayloadData = json_encode($payload_data); |
Step 4: Create Payment Order Request
Now, I am going to use PHP curl to create a payment order request. You can copy and paste the below code into your project file. You can also check API Documentation: https://documenter.getpostman.com/view/1665248/2s9Y5U15tk
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.ekqr.in/api/create_order', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>$jsonPayloadData, CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { $res = json_decode($response); if(isset($res->status)){ $order_id=$res->data->order_id; $payUrl=$res->data->payment_url; $upi_hash=$res->data->upi_id_hash; header('Location:'.$payUrl); } } |
Remember to replace ‘YOUR_API_KEY’, ‘YOUR_REDIRECT_URL’, and other placeholders with your actual credentials and data.
After successfully creating an order request, You will get a response like below details:
2 3 4 5 6 7 8 9 10 11 12 |
{ "status": true, "msg": "Order Created", "data": { "order_id": 12345678, "payment_url": "https://merchant.upigateway.com/gateway/pay/1234d59177fb9e775bf7asdfqwerxcvb", "upi_id_hash": "5257a58f98152ce360ef6e7e8083a10d3ae610a4ac5b3df31a9638cf9e0d69f1", } } |
You can see the payment URL in response. We will get this payment URL and redirect the customer to it like the below code:
2 3 4 5 |
$payUrl=$res->data->payment_url; redirect($payUrl); |
Now you have to redirect your customer to the payment URL where you will get a QR Code like below.
Payment Dynamic QR Code
Pay by scanning the QR code.
This is just a basic starting point; you’ll need to handle the response from UPIGateway on the callback page success.php and implement the necessary logic like saving the response in the database to complete the payment.
Step 5: Callback URL transaction response
You will get a response on the callback page success.php in GET Method as parameters
2 3 4 5 6 7 |
if($_GET['txn_id']){ $txn_id =$_GET['txn_id']; $client_txn_id =$_GET['client_txn_id']; } |
Experience the future of payments with UPIGateway’s Dynamic QR Code Service.
Wrapping Words
These are the simple and easy steps to Integrate UPIGateway’s Dynamic QR Code Service in PHP. You can modify and customize code as per your requirements.
Do you want to get implementation help, or modify or extend the functionality of this script? Submit a paid service request
FAQ’s:
The capabilities of UPIGateway’s Dynamic QR Code Service extend beyond just website payments. You can utilize this service for a variety of platforms, including:
1. Accept Payments via Websites: Seamlessly integrate dynamic QR codes for web-based transactions.
2. Accept Payments via OTT & Smart TV Apps: Extend your reach by accepting payments through Over-The-Top (OTT) and Smart TV applications.
3. Accept Payments In-Store: If you have a physical presence, you can offer your customers the convenience of making payments in-store using dynamic QR codes.
4. Accept Payments on Self-Serving Kiosks: UPIGateway’s service is adaptable and can be implemented on self-serving kiosks for a user-friendly payment experience.
Yes, It’s a great advantage that UPIGateway QR supports payments through all UPI-enabled apps and bank accounts. This means your customers can use popular apps like Paytm, Google Pay, PhonePe, BHIM, and more.
Indeed, UPIGateway employs advanced security measures to safeguard your transactions and sensitive information.
it’s important to clarify that UPIGateway does not provide payment gateway services, it offers a Dynamic QR Code Service.
Related Article
Integrate Recurring Stripe Subscription Payment with PHP
Integrate Blockonomics bitcoin payment gateway in PHP
Pradeep Maurya is the Professional Web Developer & Designer and the Founder of “Tutorials website”. He lives in Delhi and loves to be a self-dependent person. As an owner, he is trying his best to improve this platform day by day. His passion, dedication and quick decision making ability to stand apart from others. He’s an avid blogger and writes on the publications like Dzone, e27.co